package com.study.d026effect;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.effect.BlurType;
import javafx.scene.effect.BoxBlur;
import javafx.scene.effect.ColorInput;
import javafx.scene.effect.DropShadow;
import javafx.scene.effect.Effect;
import javafx.scene.effect.InnerShadow;
import javafx.scene.effect.Shadow;
import javafx.scene.image.Image;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.paint.ImagePattern;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Polygon;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;

/** 方框模糊类
*@description
*@author xtayhame
*date 2020年3月21日
*version
*since v1.0
*/
public class ColorInputMain extends Application{
	public static void main(String[] args) {
		launch(args);
	}
	@Override
	public void start(Stage stage) throws Exception {
		AnchorPane anchorPane = new AnchorPane	();
		HBox hBox = new HBox(20);
		Button button = new Button("测试阴影效果");
		Label label = new Label("测试阴影效果");
		Rectangle rectangle = new Rectangle(70, 70,Paint.valueOf("#218868"));
		Circle circle = new Circle(80);


		hBox.getChildren().addAll(button,label,rectangle,circle);

		//hBox.setEffect(getDropShadowEffect());

		anchorPane.getChildren().add(hBox);
		AnchorPane.setTopAnchor(hBox, 30.0);
		stage.setScene(new Scene(anchorPane, 800, 400));
		stage.show();

		 Effect effect=getInnerShadowEffect();
		 button.setEffect(effect);
		 label.setEffect(effect);
		 rectangle.setEffect(effect);
		 circle.setEffect(effect);
	}

	public Effect getInnerShadowEffect(){
		 ColorInput effect = new ColorInput();
		effect.setHeight(100);
		effect.setHeight(100);
		effect.setX(0);
		effect.setY(0);
		effect.setPaint(Paint.valueOf("#00FF0000"));

		return effect;
	}
}
